<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<title>${appname}</title>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<%@ include file="/WEB-INF/view/common/css_js_ace.jsp"%>
<script type="text/javascript">
	$(function() {
		$('#inputForm input').tooltip();
		//表单验证
		$('#inputForm').checkForm();
		$('#inputForm').ajaxForm({
			url : _ctx + "/pub/sysmgr/usermgr/add_user.do",
			type : "post",
			dataType : "json",
			beforeSubmit: function(){
	        	var checkReturn = $('#inputForm').checkForm(null,false);
	        	if(checkReturn){
	        		$("#sbmBtn").attr("disabled","disabled");
	        	}
		       return checkReturn;
	        },
			clearForm : false,
			resetForm : false,
			success : function(resp) {
				if (resp.status == '1') {
					parent.ui.msg(resp.msg, 1);
					ui.go(_ctx + '/pub/sysmgr/usermgr/user_list.do');
				} else {
					parent.ui.msg(resp.msg, 0);
					$("#sbmBtn").removeClass("disabled").attr("disabled", null);
				}
			},
			error : function(resp) {
				parent.ui.msg('请求发送失败', 0);
				$("#sbmBtn").removeClass("disabled").attr("disabled", null);
			}
		});
	});
</script>
</head>
<body>
<div class="main-container" id="main-container">
		<div class="main-container-inner">
			<div class="main-content" style="margin-left: 0px;">
				<div class="breadcrumbs" id="breadcrumbs">
					<ul class="breadcrumb">
						<li><i class="icon-home home-icon"></i>系统管理</li>
						<li>用户管理</li>
						<li class="active">添加用户</li>
					</ul>
				</div>
				<div class="page-content">
					<div class="row">
						<div class="col-xs-12">
							<div class="widget-box">
								<div class="widget-header widget-header-flat">
									<div class="widget-toolbar no-border">
										<a class="btn btn-primary btn-xs"
											href="${ctx}/pub/sysmgr/usermgr/user_list.do"><i
											class="icon-arrow-left"></i> 返回&nbsp;&nbsp;</a>
									</div>
								</div>
								<div class="widget-body">
									<div class="widget-main">
										<form class="form-horizontal" role="form" id="inputForm" action="${ctx}/pub/sysmgr/usermgr/add_user.do"  method="post" >
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">用户名*</div>
												<div class="col-sm-9" style="padding-top: 7px;">
													<input type="text" class="col-xs-10 col-sm-5"
														name="userName" id="userName" datatype="require|ajax|safeString2"
														msg="请输入用户名!|用户名称重复！|不允许输入特殊字符"
														url="${ctx }/pub/sysmgr/usermgr/isNameAvailable.do"
														oldValue="" title="必填项,用户名" placeholder="请输入用户名" maxlength="30"/>
												</div>
											</div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">密码 *</div>
												<div class="col-sm-9">
													<input type="password" class="col-xs-10 col-sm-5" name="passWd"
														id="passWd" datatype="require" msg="请输入密码！"
														oldValue="" title="必填项,密码" placeholder="请输入密码" />
												</div>
											</div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right" 
													for="form-field-1">确认新密码 *</div>
												<div class="col-sm-9">
													<input type="password" class="col-xs-10 col-sm-5" 
														value=""  name="confirmPassword" id="confirmPassword" datatype="require|repeat" to="passWd" placeholder="请再一次输入新密码"
														min="6" max="50" msg="请输入密码|两次输入的密码不匹配，请重新输入！" 
														title="请确认密码"/>
												</div>
											</div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">电子邮箱 *</div>
												<div class="col-sm-9">
													<input type="email" class="col-xs-10 col-sm-5" name="email"
														id="email" datatype="require" msg="请输入电子邮箱！" title="必填项,电子邮箱"
														placeholder="请输入电子邮箱" />
												</div>
											</div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-1">电话 *</div>
												<div class="col-sm-9">
													<input type="text" class="col-xs-10 col-sm-5" name="tel"
														id="tel" datatype="require" msg="请输入电话！" title="必填项,电话"
														placeholder="请输入电话" />
												</div>
											</div>
											<div class="space-4"></div>
											<div class="form-group">
												<div class="col-sm-3 control-label no-padding-right"
													for="form-field-2">备注</div>
												<div class="col-sm-9 ">
													<textarea class="col-sm-5" placeholder="请输入备注"
														name="remark" id="remark" title="备注"></textarea>
												</div>
											</div>
											<hr>
											<div class="clearfix form-group">
												<div class="col-md-offset-3 col-md-9">
													<button type="submit" class="btn btn-sm btn-info"
														id="sbmBtn">
														<i class="icon-ok bigger-110"></i>提交
													</button>
												</div>
											</div>
										</form>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
</html>